#pragma once

class WMReaderException : public std::exception
{
public:
    const char* what() const throw()
    {
        return message.c_str();
    }
protected:
    std::string message;
};

class ConnectFailed : public WMReaderException
{
public:
    ConnectFailed()
    {
        message = QT_TR_NOOP("Failed to connect to the mobile device.\n"
                             "Please, check connection with the mobile device.");
    }
    ~ConnectFailed() throw() {}
};

class DisconnectFailed : public WMReaderException
{
public:
    DisconnectFailed()
    {
        message = QT_TR_NOOP("Failed to disconnect from the mobile device.");
    }
    ~DisconnectFailed() throw() {}
};

class DeviceIsNotConnected : public WMReaderException
{
public:
    DeviceIsNotConnected()
    {
        message = QT_TR_NOOP("Mobile device is not available.\n"
                             "Please, make sure that mobile device is "
                             "connected to the computer.");
    }
    ~DeviceIsNotConnected() throw() {}
};

class RetrieveDataFailed : public WMReaderException
{
public:
    RetrieveDataFailed()
    {
        message = QT_TR_NOOP("Failed to retrieve the data from device.\n"
                             "Possibly, you are not connected with the mobile device.");
    }
    ~RetrieveDataFailed() throw() {}
};

class RetrieveAppMgrPathFailed : public WMReaderException
{
public:
    RetrieveAppMgrPathFailed()
    {
        message = QT_TR_NOOP("Failed to retrieve the path to the CeAppMgr.");
    }
    ~RetrieveAppMgrPathFailed() throw() {}
};

class LibInstallFailed : public WMReaderException
{
public:
    LibInstallFailed()
    {
        message = QT_TR_NOOP("Failed to install the DLL-component into the mobile device.");
    }
    ~LibInstallFailed() throw() {}
};